package wqh.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wqh.dao.AlarmEventDao;
import wqh.domain.AlarmEvent;
import wqh.service.AlarmEventService;

import java.util.List;

@Service("alarmEventService")
public class AlarmEventServiceImpl implements AlarmEventService {

    @Autowired
    private AlarmEventDao alarmEventDao;

    public Integer selectCount() {
        return this.alarmEventDao.selectCount();
    }

    public List<AlarmEvent> findAllRecord() {
        return this.alarmEventDao.findAllRecord();
    }

    public AlarmEvent findById(Integer id) {
        return this.alarmEventDao.findById(id);
    }

    public List<AlarmEvent> findByIpAndChannel(String ipStr, Byte channel_number) {
        return this.alarmEventDao.findByIpAndChannel(ipStr, channel_number);
    }

    public List<AlarmEvent> findByTimeRange(Integer start, Integer end) {
        return this.alarmEventDao.findByTimeRange(start, end);
    }

    public int countByTimeRange(Integer start, Integer end) {
        return this.alarmEventDao.countByTimeRange(start, end);
    }

    public int deleteById(Integer id) {
        return this.alarmEventDao.deleteById(id);
    }

    public int insertRecord(AlarmEvent alarmEvent) {
        return this.alarmEventDao.insertRecord(alarmEvent);
    }
}
